# for module compiling
import os

Import('env')

LIBRARY_NAME = '../sqlite3'     #动态库的名称

INCLUDE_PATH = []
for root,dirs,files in os.walk('.'):
    for file in files:
        if file.endswith('.h'):
            if root not in INCLUDE_PATH:
                INCLUDE_PATH.append(root)
else:
    print('编译sqlite3时头文件的搜索路径为:{}'.format(INCLUDE_PATH))

env['CPPPATH'] = INCLUDE_PATH

LIBRARIES = []
LIBRARIES.append('pthread')
LIBRARIES.append('dl')
env['LIBS'] = LIBRARIES

SOURCES = Glob('*.c')
lib = env.SharedLibrary(target = LIBRARY_NAME, source=[SOURCES])# 生成动态库

# scons -c时不要将生成的库文件删除
env.NoClean(lib)



